package com.axjy.yycg.mapper;

import com.axjy.yycg.pojo.Sysuser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysuserMapper {



    @Select("select * from sysuser where userid=#{userid} and pwd=#{pwd}")
    Sysuser login(@Param("userid") String userid, @Param("pwd") String pwd);

    @Select("select * from sysuser where id=#{id}")
    Sysuser findUserById(Integer id);


    //根据roleId查询用户
    @Select("select * from sysuser where roleId=#{roleId}")
    Sysuser findUserByRoleId(Integer roleId);

    @Select("select * from sysuser")
    List<Sysuser> list();
    @Insert("insert into sysuser()")
    Integer add(Sysuser sysuser);

}
